<script language="javascript">
$(function(){
	$('form').form({ 
		success:function(data){
			var data = runJson(data);
			if(data.status == 0){
				alertText(data.info, 'error');
			}else{
				alertText(data.info, 'success', 'back');
			}
		}   
	}); 
});
</script>
<div class="box">
	<div class="easyui-panel" title="{$page_title}">
        <div class="datagrid-toolbar">
            <a href="{:U('Dept/index')}" class="easyui-linkbutton" plain="true" iconCls="icon-list">门店管理</a>
            <eq name='ACTION_NAME' value='edit'>
            |
            <a href="{:U('Dept/add')}" class="easyui-linkbutton" plain="true" iconCls="icon-add">添加新门店</a>
            </eq>
        </div>
        <form action="<eq name='ACTION_NAME' value='edit'>{:U('Dept/update')}<else />{:U('Dept/insert')}</eq>&ajax=true" method="post">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
          <tr>
            <td class="label">门店名称：</td>
            <td>
            <input type="text" value="{$vo.name}" id="name" name="name" style="width:200px;" class="easyui-validatebox input" required="true" validType="length[2,20]" />
            </td>
          </tr>
          <tr>
            <td class="label">门店所在地：</td>
            <td>
            <span id="province_id">
            <select name="province" id="province" onChange="selectRegion('city', 'province')">
            <option value="0">请选择省份</option>
            <volist name="province" id="p">
            <option value="{$key}" <if condition="$key eq $vo['province']">selected</if>>{$p}</option>
            </volist>
            </select>
            </span>&nbsp;
            <span id="city_id">
            <eq name='ACTION_NAME' value='edit'>
            <select name="city" id="city" onchange="selectRegion('district', 'city')">
            <option value="0">请选择城市</option>
            <volist name="city" id="c">
            <option value="{$key}" <if condition="$key eq $vo['city']">selected</if>>{$c}</option>
            </volist>
            </select>
            </eq>
            </span>&nbsp;
            <span id="district_id">
            <eq name='ACTION_NAME' value='edit'>
            <select name="district" id="district">
            <option value="0">请选择街道</option>
            <volist name="district" id="d">
            <option value="{$key}" <if condition="$key eq $vo['district']">selected</if>>{$d}</option>
            </volist>
           	</option>
            </select>
            </eq>
            </span>
            </td>
          </tr>
          <tr>
            <td class="label">详细地址：</td>
            <td>
            <input type="text" class="easyui-validatebox input" required="true" validType="length[5,20]" value="{$vo.address}" id="address" name="address" style="width:250px;" />
            </td>
          </tr>
          <tr>
            <td class="label">门店联系人：</td>
            <td>
            <input type="text" class="easyui-validatebox input" required="true" validType="length[2,20]" value="{$vo.contact_name}" id="contact_name" name="contact_name" style="width:200px;" />
            </td>
          </tr>
          <tr id="appsid">
            <td class="label">电话：</td>
            <td>
            <input type="text" class="easyui-validatebox input" name="tel" id="tel" value="{$vo.tel}" style="width:200px;" required="true" validType="length[2,20]" />
            </td>
          </tr>
          <tr>
            <td class="label">传真：</td>
            <td>
            <input type="text" class="input" name="fax" id="fax" value="{$vo.fax}" style="width:200px;" />
            </td>
          </tr>
          <tr>
            <td class="label">手机：</td>
            <td>
            <input type="text" class="input" name="phone" id="phone" value="{$vo.phone}" style="width:200px;" />
            </td>
          </tr>
          <tr>
            <td class="label">电子邮件：</td>
            <td>
            <input type="text" class="input" name="email" id="email" value="{$vo.email}" style="width:200px;" />
            </td>
          </tr>
          <tr>
            <td class="label">排序：</td>
            <td>
            <input type="text" class="input" name="sort" id="sort" value="{$vo.sort}" style="width:100px;" />
            </td>
          </tr>
          <tr>
            <td class="label">备注：</td>
            <td>
            <textarea class="input" name="remark" id="remark" style="width:300px; height:100px;">{$vo.remark}</textarea>
            </td>
          </tr>
          <tr>
            <td class="label">&nbsp;</td>
            <td>
            <eq name='ACTION_NAME' value='edit'><input type="hidden" name="id" value="{$vo.id}" /></eq>
            <input align="absmiddle" class="button" type="submit" value="保存" id="submits" onclick="return $('form').form('validate')" />
            </td>
          </tr>
        </table>
        </form>
    </div>
</div>